import { Map, MapMouseEvent, Point, AnySourceData } from "mapbox-gl";
export function renderLayerGroup(id: string, map: Map, properties: any) {
  map.addLayer({
    id: id,
    type: "fill", // 使用填充型来表示面
    source: id,
    layout: properties.layout || {},
    paint: properties.paint || {},
    filter: ["==", ["geometry-type"], "Polygon"], // 过滤所有面
  });
  map.addLayer({
    id: `${id}-text`,
    type: "symbol", // 使用填充型来表示面
    source: id,
    layout: {
      "text-field": ["get", "name"],
      "text-size": 12,
    },
    paint: {
      "text-color": "#fff",
    },
    filter: ["==", ["geometry-type"], "Polygon"], // 过滤所有面
  });
}
